using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace Adex
{
	/// <summary>
	/// Strongly-typed collection for the CommercialLog1 class.
	/// </summary>
    [Serializable]
	public partial class CommercialLog1Collection : ActiveList<CommercialLog1, CommercialLog1Collection>
	{	   
		public CommercialLog1Collection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>CommercialLog1Collection</returns>
		public CommercialLog1Collection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                CommercialLog1 o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the CommercialLog1 table.
	/// </summary>
	[Serializable]
	public partial class CommercialLog1 : ActiveRecord<CommercialLog1>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public CommercialLog1()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public CommercialLog1(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public CommercialLog1(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public CommercialLog1(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("CommercialLog1", TableType.Table, DataService.GetInstance("Adex"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int32;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarMediaCode = new TableSchema.TableColumn(schema);
				colvarMediaCode.ColumnName = "MediaCode";
				colvarMediaCode.DataType = DbType.String;
				colvarMediaCode.MaxLength = 50;
				colvarMediaCode.AutoIncrement = false;
				colvarMediaCode.IsNullable = true;
				colvarMediaCode.IsPrimaryKey = false;
				colvarMediaCode.IsForeignKey = false;
				colvarMediaCode.IsReadOnly = false;
				colvarMediaCode.DefaultSetting = @"";
				colvarMediaCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMediaCode);
				
				TableSchema.TableColumn colvarRFDate = new TableSchema.TableColumn(schema);
				colvarRFDate.ColumnName = "RFDate";
				colvarRFDate.DataType = DbType.String;
				colvarRFDate.MaxLength = 50;
				colvarRFDate.AutoIncrement = false;
				colvarRFDate.IsNullable = true;
				colvarRFDate.IsPrimaryKey = false;
				colvarRFDate.IsForeignKey = false;
				colvarRFDate.IsReadOnly = false;
				colvarRFDate.DefaultSetting = @"";
				colvarRFDate.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRFDate);
				
				TableSchema.TableColumn colvarTimeStart = new TableSchema.TableColumn(schema);
				colvarTimeStart.ColumnName = "TimeStart";
				colvarTimeStart.DataType = DbType.String;
				colvarTimeStart.MaxLength = 50;
				colvarTimeStart.AutoIncrement = false;
				colvarTimeStart.IsNullable = true;
				colvarTimeStart.IsPrimaryKey = false;
				colvarTimeStart.IsForeignKey = false;
				colvarTimeStart.IsReadOnly = false;
				colvarTimeStart.DefaultSetting = @"";
				colvarTimeStart.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTimeStart);
				
				TableSchema.TableColumn colvarTimeEnd = new TableSchema.TableColumn(schema);
				colvarTimeEnd.ColumnName = "TimeEnd";
				colvarTimeEnd.DataType = DbType.String;
				colvarTimeEnd.MaxLength = 50;
				colvarTimeEnd.AutoIncrement = false;
				colvarTimeEnd.IsNullable = true;
				colvarTimeEnd.IsPrimaryKey = false;
				colvarTimeEnd.IsForeignKey = false;
				colvarTimeEnd.IsReadOnly = false;
				colvarTimeEnd.DefaultSetting = @"";
				colvarTimeEnd.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTimeEnd);
				
				TableSchema.TableColumn colvarDuration = new TableSchema.TableColumn(schema);
				colvarDuration.ColumnName = "Duration";
				colvarDuration.DataType = DbType.String;
				colvarDuration.MaxLength = 50;
				colvarDuration.AutoIncrement = false;
				colvarDuration.IsNullable = true;
				colvarDuration.IsPrimaryKey = false;
				colvarDuration.IsForeignKey = false;
				colvarDuration.IsReadOnly = false;
				colvarDuration.DefaultSetting = @"";
				colvarDuration.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDuration);
				
				TableSchema.TableColumn colvarProgramCode = new TableSchema.TableColumn(schema);
				colvarProgramCode.ColumnName = "ProgramCode";
				colvarProgramCode.DataType = DbType.String;
				colvarProgramCode.MaxLength = 50;
				colvarProgramCode.AutoIncrement = false;
				colvarProgramCode.IsNullable = true;
				colvarProgramCode.IsPrimaryKey = false;
				colvarProgramCode.IsForeignKey = false;
				colvarProgramCode.IsReadOnly = false;
				colvarProgramCode.DefaultSetting = @"";
				colvarProgramCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProgramCode);
				
				TableSchema.TableColumn colvarProgramName = new TableSchema.TableColumn(schema);
				colvarProgramName.ColumnName = "ProgramName";
				colvarProgramName.DataType = DbType.AnsiString;
				colvarProgramName.MaxLength = -1;
				colvarProgramName.AutoIncrement = false;
				colvarProgramName.IsNullable = true;
				colvarProgramName.IsPrimaryKey = false;
				colvarProgramName.IsForeignKey = false;
				colvarProgramName.IsReadOnly = false;
				colvarProgramName.DefaultSetting = @"";
				colvarProgramName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProgramName);
				
				TableSchema.TableColumn colvarTypology = new TableSchema.TableColumn(schema);
				colvarTypology.ColumnName = "Typology";
				colvarTypology.DataType = DbType.AnsiString;
				colvarTypology.MaxLength = 5;
				colvarTypology.AutoIncrement = false;
				colvarTypology.IsNullable = true;
				colvarTypology.IsPrimaryKey = false;
				colvarTypology.IsForeignKey = false;
				colvarTypology.IsReadOnly = false;
				colvarTypology.DefaultSetting = @"";
				colvarTypology.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTypology);
				
				TableSchema.TableColumn colvarNominalCost = new TableSchema.TableColumn(schema);
				colvarNominalCost.ColumnName = "NominalCost";
				colvarNominalCost.DataType = DbType.Currency;
				colvarNominalCost.MaxLength = 0;
				colvarNominalCost.AutoIncrement = false;
				colvarNominalCost.IsNullable = true;
				colvarNominalCost.IsPrimaryKey = false;
				colvarNominalCost.IsForeignKey = false;
				colvarNominalCost.IsReadOnly = false;
				colvarNominalCost.DefaultSetting = @"";
				colvarNominalCost.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNominalCost);
				
				TableSchema.TableColumn colvarRealCost = new TableSchema.TableColumn(schema);
				colvarRealCost.ColumnName = "RealCost";
				colvarRealCost.DataType = DbType.Currency;
				colvarRealCost.MaxLength = 0;
				colvarRealCost.AutoIncrement = false;
				colvarRealCost.IsNullable = true;
				colvarRealCost.IsPrimaryKey = false;
				colvarRealCost.IsForeignKey = false;
				colvarRealCost.IsReadOnly = false;
				colvarRealCost.DefaultSetting = @"";
				colvarRealCost.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRealCost);
				
				TableSchema.TableColumn colvarPositionInBreak = new TableSchema.TableColumn(schema);
				colvarPositionInBreak.ColumnName = "PositionInBreak";
				colvarPositionInBreak.DataType = DbType.String;
				colvarPositionInBreak.MaxLength = 50;
				colvarPositionInBreak.AutoIncrement = false;
				colvarPositionInBreak.IsNullable = true;
				colvarPositionInBreak.IsPrimaryKey = false;
				colvarPositionInBreak.IsForeignKey = false;
				colvarPositionInBreak.IsReadOnly = false;
				colvarPositionInBreak.DefaultSetting = @"";
				colvarPositionInBreak.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPositionInBreak);
				
				TableSchema.TableColumn colvarNumberOfSpotsInBreak = new TableSchema.TableColumn(schema);
				colvarNumberOfSpotsInBreak.ColumnName = "NumberOfSpotsInBreak";
				colvarNumberOfSpotsInBreak.DataType = DbType.String;
				colvarNumberOfSpotsInBreak.MaxLength = 50;
				colvarNumberOfSpotsInBreak.AutoIncrement = false;
				colvarNumberOfSpotsInBreak.IsNullable = true;
				colvarNumberOfSpotsInBreak.IsPrimaryKey = false;
				colvarNumberOfSpotsInBreak.IsForeignKey = false;
				colvarNumberOfSpotsInBreak.IsReadOnly = false;
				colvarNumberOfSpotsInBreak.DefaultSetting = @"";
				colvarNumberOfSpotsInBreak.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNumberOfSpotsInBreak);
				
				TableSchema.TableColumn colvarTypeOfSpot = new TableSchema.TableColumn(schema);
				colvarTypeOfSpot.ColumnName = "TypeOfSpot";
				colvarTypeOfSpot.DataType = DbType.String;
				colvarTypeOfSpot.MaxLength = 50;
				colvarTypeOfSpot.AutoIncrement = false;
				colvarTypeOfSpot.IsNullable = true;
				colvarTypeOfSpot.IsPrimaryKey = false;
				colvarTypeOfSpot.IsForeignKey = false;
				colvarTypeOfSpot.IsReadOnly = false;
				colvarTypeOfSpot.DefaultSetting = @"";
				colvarTypeOfSpot.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTypeOfSpot);
				
				TableSchema.TableColumn colvarTypeOfBuyCode = new TableSchema.TableColumn(schema);
				colvarTypeOfBuyCode.ColumnName = "TypeOfBuyCode";
				colvarTypeOfBuyCode.DataType = DbType.String;
				colvarTypeOfBuyCode.MaxLength = 50;
				colvarTypeOfBuyCode.AutoIncrement = false;
				colvarTypeOfBuyCode.IsNullable = true;
				colvarTypeOfBuyCode.IsPrimaryKey = false;
				colvarTypeOfBuyCode.IsForeignKey = false;
				colvarTypeOfBuyCode.IsReadOnly = false;
				colvarTypeOfBuyCode.DefaultSetting = @"";
				colvarTypeOfBuyCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTypeOfBuyCode);
				
				TableSchema.TableColumn colvarTypeOfBuyName = new TableSchema.TableColumn(schema);
				colvarTypeOfBuyName.ColumnName = "TypeOfBuyName";
				colvarTypeOfBuyName.DataType = DbType.AnsiString;
				colvarTypeOfBuyName.MaxLength = -1;
				colvarTypeOfBuyName.AutoIncrement = false;
				colvarTypeOfBuyName.IsNullable = true;
				colvarTypeOfBuyName.IsPrimaryKey = false;
				colvarTypeOfBuyName.IsForeignKey = false;
				colvarTypeOfBuyName.IsReadOnly = false;
				colvarTypeOfBuyName.DefaultSetting = @"";
				colvarTypeOfBuyName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTypeOfBuyName);
				
				TableSchema.TableColumn colvarProdVersionCode = new TableSchema.TableColumn(schema);
				colvarProdVersionCode.ColumnName = "ProdVersionCode";
				colvarProdVersionCode.DataType = DbType.String;
				colvarProdVersionCode.MaxLength = 50;
				colvarProdVersionCode.AutoIncrement = false;
				colvarProdVersionCode.IsNullable = true;
				colvarProdVersionCode.IsPrimaryKey = false;
				colvarProdVersionCode.IsForeignKey = false;
				colvarProdVersionCode.IsReadOnly = false;
				colvarProdVersionCode.DefaultSetting = @"";
				colvarProdVersionCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionCode);
				
				TableSchema.TableColumn colvarProdVersionName = new TableSchema.TableColumn(schema);
				colvarProdVersionName.ColumnName = "ProdVersionName";
				colvarProdVersionName.DataType = DbType.AnsiString;
				colvarProdVersionName.MaxLength = -1;
				colvarProdVersionName.AutoIncrement = false;
				colvarProdVersionName.IsNullable = true;
				colvarProdVersionName.IsPrimaryKey = false;
				colvarProdVersionName.IsForeignKey = false;
				colvarProdVersionName.IsReadOnly = false;
				colvarProdVersionName.DefaultSetting = @"";
				colvarProdVersionName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionName);
				
				TableSchema.TableColumn colvarProductCode = new TableSchema.TableColumn(schema);
				colvarProductCode.ColumnName = "ProductCode";
				colvarProductCode.DataType = DbType.String;
				colvarProductCode.MaxLength = 50;
				colvarProductCode.AutoIncrement = false;
				colvarProductCode.IsNullable = true;
				colvarProductCode.IsPrimaryKey = false;
				colvarProductCode.IsForeignKey = false;
				colvarProductCode.IsReadOnly = false;
				colvarProductCode.DefaultSetting = @"";
				colvarProductCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProductCode);
				
				TableSchema.TableColumn colvarProductName = new TableSchema.TableColumn(schema);
				colvarProductName.ColumnName = "ProductName";
				colvarProductName.DataType = DbType.AnsiString;
				colvarProductName.MaxLength = -1;
				colvarProductName.AutoIncrement = false;
				colvarProductName.IsNullable = true;
				colvarProductName.IsPrimaryKey = false;
				colvarProductName.IsForeignKey = false;
				colvarProductName.IsReadOnly = false;
				colvarProductName.DefaultSetting = @"";
				colvarProductName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProductName);
				
				TableSchema.TableColumn colvarConstant1 = new TableSchema.TableColumn(schema);
				colvarConstant1.ColumnName = "Constant1";
				colvarConstant1.DataType = DbType.AnsiString;
				colvarConstant1.MaxLength = -1;
				colvarConstant1.AutoIncrement = false;
				colvarConstant1.IsNullable = true;
				colvarConstant1.IsPrimaryKey = false;
				colvarConstant1.IsForeignKey = false;
				colvarConstant1.IsReadOnly = false;
				colvarConstant1.DefaultSetting = @"";
				colvarConstant1.ForeignKeyTableName = "";
				schema.Columns.Add(colvarConstant1);
				
				TableSchema.TableColumn colvarConstant2 = new TableSchema.TableColumn(schema);
				colvarConstant2.ColumnName = "Constant2";
				colvarConstant2.DataType = DbType.AnsiString;
				colvarConstant2.MaxLength = -1;
				colvarConstant2.AutoIncrement = false;
				colvarConstant2.IsNullable = true;
				colvarConstant2.IsPrimaryKey = false;
				colvarConstant2.IsForeignKey = false;
				colvarConstant2.IsReadOnly = false;
				colvarConstant2.DefaultSetting = @"";
				colvarConstant2.ForeignKeyTableName = "";
				schema.Columns.Add(colvarConstant2);
				
				TableSchema.TableColumn colvarCategoryCode = new TableSchema.TableColumn(schema);
				colvarCategoryCode.ColumnName = "CategoryCode";
				colvarCategoryCode.DataType = DbType.String;
				colvarCategoryCode.MaxLength = 50;
				colvarCategoryCode.AutoIncrement = false;
				colvarCategoryCode.IsNullable = true;
				colvarCategoryCode.IsPrimaryKey = false;
				colvarCategoryCode.IsForeignKey = false;
				colvarCategoryCode.IsReadOnly = false;
				colvarCategoryCode.DefaultSetting = @"";
				colvarCategoryCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCategoryCode);
				
				TableSchema.TableColumn colvarCategoryName = new TableSchema.TableColumn(schema);
				colvarCategoryName.ColumnName = "CategoryName";
				colvarCategoryName.DataType = DbType.AnsiString;
				colvarCategoryName.MaxLength = -1;
				colvarCategoryName.AutoIncrement = false;
				colvarCategoryName.IsNullable = true;
				colvarCategoryName.IsPrimaryKey = false;
				colvarCategoryName.IsForeignKey = false;
				colvarCategoryName.IsReadOnly = false;
				colvarCategoryName.DefaultSetting = @"";
				colvarCategoryName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCategoryName);
				
				TableSchema.TableColumn colvarSubSectorCode = new TableSchema.TableColumn(schema);
				colvarSubSectorCode.ColumnName = "SubSectorCode";
				colvarSubSectorCode.DataType = DbType.String;
				colvarSubSectorCode.MaxLength = 50;
				colvarSubSectorCode.AutoIncrement = false;
				colvarSubSectorCode.IsNullable = true;
				colvarSubSectorCode.IsPrimaryKey = false;
				colvarSubSectorCode.IsForeignKey = false;
				colvarSubSectorCode.IsReadOnly = false;
				colvarSubSectorCode.DefaultSetting = @"";
				colvarSubSectorCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSubSectorCode);
				
				TableSchema.TableColumn colvarSubSectorName = new TableSchema.TableColumn(schema);
				colvarSubSectorName.ColumnName = "SubSectorName";
				colvarSubSectorName.DataType = DbType.AnsiString;
				colvarSubSectorName.MaxLength = -1;
				colvarSubSectorName.AutoIncrement = false;
				colvarSubSectorName.IsNullable = true;
				colvarSubSectorName.IsPrimaryKey = false;
				colvarSubSectorName.IsForeignKey = false;
				colvarSubSectorName.IsReadOnly = false;
				colvarSubSectorName.DefaultSetting = @"";
				colvarSubSectorName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSubSectorName);
				
				TableSchema.TableColumn colvarSectorCode = new TableSchema.TableColumn(schema);
				colvarSectorCode.ColumnName = "SectorCode";
				colvarSectorCode.DataType = DbType.String;
				colvarSectorCode.MaxLength = 50;
				colvarSectorCode.AutoIncrement = false;
				colvarSectorCode.IsNullable = true;
				colvarSectorCode.IsPrimaryKey = false;
				colvarSectorCode.IsForeignKey = false;
				colvarSectorCode.IsReadOnly = false;
				colvarSectorCode.DefaultSetting = @"";
				colvarSectorCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSectorCode);
				
				TableSchema.TableColumn colvarSectorName = new TableSchema.TableColumn(schema);
				colvarSectorName.ColumnName = "SectorName";
				colvarSectorName.DataType = DbType.AnsiString;
				colvarSectorName.MaxLength = -1;
				colvarSectorName.AutoIncrement = false;
				colvarSectorName.IsNullable = true;
				colvarSectorName.IsPrimaryKey = false;
				colvarSectorName.IsForeignKey = false;
				colvarSectorName.IsReadOnly = false;
				colvarSectorName.DefaultSetting = @"";
				colvarSectorName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSectorName);
				
				TableSchema.TableColumn colvarConstant3 = new TableSchema.TableColumn(schema);
				colvarConstant3.ColumnName = "Constant3";
				colvarConstant3.DataType = DbType.AnsiString;
				colvarConstant3.MaxLength = -1;
				colvarConstant3.AutoIncrement = false;
				colvarConstant3.IsNullable = true;
				colvarConstant3.IsPrimaryKey = false;
				colvarConstant3.IsForeignKey = false;
				colvarConstant3.IsReadOnly = false;
				colvarConstant3.DefaultSetting = @"";
				colvarConstant3.ForeignKeyTableName = "";
				schema.Columns.Add(colvarConstant3);
				
				TableSchema.TableColumn colvarBrandCode = new TableSchema.TableColumn(schema);
				colvarBrandCode.ColumnName = "BrandCode";
				colvarBrandCode.DataType = DbType.String;
				colvarBrandCode.MaxLength = 50;
				colvarBrandCode.AutoIncrement = false;
				colvarBrandCode.IsNullable = true;
				colvarBrandCode.IsPrimaryKey = false;
				colvarBrandCode.IsForeignKey = false;
				colvarBrandCode.IsReadOnly = false;
				colvarBrandCode.DefaultSetting = @"";
				colvarBrandCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBrandCode);
				
				TableSchema.TableColumn colvarBrandName = new TableSchema.TableColumn(schema);
				colvarBrandName.ColumnName = "BrandName";
				colvarBrandName.DataType = DbType.AnsiString;
				colvarBrandName.MaxLength = -1;
				colvarBrandName.AutoIncrement = false;
				colvarBrandName.IsNullable = true;
				colvarBrandName.IsPrimaryKey = false;
				colvarBrandName.IsForeignKey = false;
				colvarBrandName.IsReadOnly = false;
				colvarBrandName.DefaultSetting = @"";
				colvarBrandName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBrandName);
				
				TableSchema.TableColumn colvarAdvertiserCode = new TableSchema.TableColumn(schema);
				colvarAdvertiserCode.ColumnName = "AdvertiserCode";
				colvarAdvertiserCode.DataType = DbType.String;
				colvarAdvertiserCode.MaxLength = 50;
				colvarAdvertiserCode.AutoIncrement = false;
				colvarAdvertiserCode.IsNullable = true;
				colvarAdvertiserCode.IsPrimaryKey = false;
				colvarAdvertiserCode.IsForeignKey = false;
				colvarAdvertiserCode.IsReadOnly = false;
				colvarAdvertiserCode.DefaultSetting = @"";
				colvarAdvertiserCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAdvertiserCode);
				
				TableSchema.TableColumn colvarAdvertiserName = new TableSchema.TableColumn(schema);
				colvarAdvertiserName.ColumnName = "AdvertiserName";
				colvarAdvertiserName.DataType = DbType.AnsiString;
				colvarAdvertiserName.MaxLength = -1;
				colvarAdvertiserName.AutoIncrement = false;
				colvarAdvertiserName.IsNullable = true;
				colvarAdvertiserName.IsPrimaryKey = false;
				colvarAdvertiserName.IsForeignKey = false;
				colvarAdvertiserName.IsReadOnly = false;
				colvarAdvertiserName.DefaultSetting = @"";
				colvarAdvertiserName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAdvertiserName);
				
				TableSchema.TableColumn colvarConstant4 = new TableSchema.TableColumn(schema);
				colvarConstant4.ColumnName = "Constant4";
				colvarConstant4.DataType = DbType.AnsiString;
				colvarConstant4.MaxLength = -1;
				colvarConstant4.AutoIncrement = false;
				colvarConstant4.IsNullable = true;
				colvarConstant4.IsPrimaryKey = false;
				colvarConstant4.IsForeignKey = false;
				colvarConstant4.IsReadOnly = false;
				colvarConstant4.DefaultSetting = @"";
				colvarConstant4.ForeignKeyTableName = "";
				schema.Columns.Add(colvarConstant4);
				
				TableSchema.TableColumn colvarAgencyCode = new TableSchema.TableColumn(schema);
				colvarAgencyCode.ColumnName = "AgencyCode";
				colvarAgencyCode.DataType = DbType.String;
				colvarAgencyCode.MaxLength = 50;
				colvarAgencyCode.AutoIncrement = false;
				colvarAgencyCode.IsNullable = true;
				colvarAgencyCode.IsPrimaryKey = false;
				colvarAgencyCode.IsForeignKey = false;
				colvarAgencyCode.IsReadOnly = false;
				colvarAgencyCode.DefaultSetting = @"";
				colvarAgencyCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAgencyCode);
				
				TableSchema.TableColumn colvarAgencyName = new TableSchema.TableColumn(schema);
				colvarAgencyName.ColumnName = "AgencyName";
				colvarAgencyName.DataType = DbType.AnsiString;
				colvarAgencyName.MaxLength = -1;
				colvarAgencyName.AutoIncrement = false;
				colvarAgencyName.IsNullable = true;
				colvarAgencyName.IsPrimaryKey = false;
				colvarAgencyName.IsForeignKey = false;
				colvarAgencyName.IsReadOnly = false;
				colvarAgencyName.DefaultSetting = @"";
				colvarAgencyName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAgencyName);
				
				TableSchema.TableColumn colvarCountryID = new TableSchema.TableColumn(schema);
				colvarCountryID.ColumnName = "CountryID";
				colvarCountryID.DataType = DbType.String;
				colvarCountryID.MaxLength = 50;
				colvarCountryID.AutoIncrement = false;
				colvarCountryID.IsNullable = true;
				colvarCountryID.IsPrimaryKey = false;
				colvarCountryID.IsForeignKey = false;
				colvarCountryID.IsReadOnly = false;
				colvarCountryID.DefaultSetting = @"";
				colvarCountryID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCountryID);
				
				TableSchema.TableColumn colvarFullVideo = new TableSchema.TableColumn(schema);
				colvarFullVideo.ColumnName = "FullVideo";
				colvarFullVideo.DataType = DbType.Boolean;
				colvarFullVideo.MaxLength = 0;
				colvarFullVideo.AutoIncrement = false;
				colvarFullVideo.IsNullable = true;
				colvarFullVideo.IsPrimaryKey = false;
				colvarFullVideo.IsForeignKey = false;
				colvarFullVideo.IsReadOnly = false;
				colvarFullVideo.DefaultSetting = @"";
				colvarFullVideo.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFullVideo);
				
				TableSchema.TableColumn colvarShortVideo = new TableSchema.TableColumn(schema);
				colvarShortVideo.ColumnName = "ShortVideo";
				colvarShortVideo.DataType = DbType.Boolean;
				colvarShortVideo.MaxLength = 0;
				colvarShortVideo.AutoIncrement = false;
				colvarShortVideo.IsNullable = true;
				colvarShortVideo.IsPrimaryKey = false;
				colvarShortVideo.IsForeignKey = false;
				colvarShortVideo.IsReadOnly = false;
				colvarShortVideo.DefaultSetting = @"";
				colvarShortVideo.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShortVideo);
				
				TableSchema.TableColumn colvarFullVideoFile = new TableSchema.TableColumn(schema);
				colvarFullVideoFile.ColumnName = "FullVideoFile";
				colvarFullVideoFile.DataType = DbType.String;
				colvarFullVideoFile.MaxLength = 100;
				colvarFullVideoFile.AutoIncrement = false;
				colvarFullVideoFile.IsNullable = true;
				colvarFullVideoFile.IsPrimaryKey = false;
				colvarFullVideoFile.IsForeignKey = false;
				colvarFullVideoFile.IsReadOnly = false;
				colvarFullVideoFile.DefaultSetting = @"";
				colvarFullVideoFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFullVideoFile);
				
				TableSchema.TableColumn colvarShortVideoFile = new TableSchema.TableColumn(schema);
				colvarShortVideoFile.ColumnName = "ShortVideoFile";
				colvarShortVideoFile.DataType = DbType.String;
				colvarShortVideoFile.MaxLength = 100;
				colvarShortVideoFile.AutoIncrement = false;
				colvarShortVideoFile.IsNullable = true;
				colvarShortVideoFile.IsPrimaryKey = false;
				colvarShortVideoFile.IsForeignKey = false;
				colvarShortVideoFile.IsReadOnly = false;
				colvarShortVideoFile.DefaultSetting = @"";
				colvarShortVideoFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShortVideoFile);
				
				TableSchema.TableColumn colvarRadioFile = new TableSchema.TableColumn(schema);
				colvarRadioFile.ColumnName = "RadioFile";
				colvarRadioFile.DataType = DbType.String;
				colvarRadioFile.MaxLength = 100;
				colvarRadioFile.AutoIncrement = false;
				colvarRadioFile.IsNullable = true;
				colvarRadioFile.IsPrimaryKey = false;
				colvarRadioFile.IsForeignKey = false;
				colvarRadioFile.IsReadOnly = false;
				colvarRadioFile.DefaultSetting = @"";
				colvarRadioFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRadioFile);
				
				TableSchema.TableColumn colvarCableFile = new TableSchema.TableColumn(schema);
				colvarCableFile.ColumnName = "CableFile";
				colvarCableFile.DataType = DbType.String;
				colvarCableFile.MaxLength = 100;
				colvarCableFile.AutoIncrement = false;
				colvarCableFile.IsNullable = true;
				colvarCableFile.IsPrimaryKey = false;
				colvarCableFile.IsForeignKey = false;
				colvarCableFile.IsReadOnly = false;
				colvarCableFile.DefaultSetting = @"";
				colvarCableFile.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCableFile);
				
				TableSchema.TableColumn colvarPreliminaryData = new TableSchema.TableColumn(schema);
				colvarPreliminaryData.ColumnName = "preliminaryData";
				colvarPreliminaryData.DataType = DbType.Boolean;
				colvarPreliminaryData.MaxLength = 0;
				colvarPreliminaryData.AutoIncrement = false;
				colvarPreliminaryData.IsNullable = true;
				colvarPreliminaryData.IsPrimaryKey = false;
				colvarPreliminaryData.IsForeignKey = false;
				colvarPreliminaryData.IsReadOnly = false;
				colvarPreliminaryData.DefaultSetting = @"";
				colvarPreliminaryData.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPreliminaryData);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Adex"].AddSchema("CommercialLog1",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public int Id 
		{
			get { return GetColumnValue<int>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("MediaCode")]
		[Bindable(true)]
		public string MediaCode 
		{
			get { return GetColumnValue<string>(Columns.MediaCode); }
			set { SetColumnValue(Columns.MediaCode, value); }
		}
		  
		[XmlAttribute("RFDate")]
		[Bindable(true)]
		public string RFDate 
		{
			get { return GetColumnValue<string>(Columns.RFDate); }
			set { SetColumnValue(Columns.RFDate, value); }
		}
		  
		[XmlAttribute("TimeStart")]
		[Bindable(true)]
		public string TimeStart 
		{
			get { return GetColumnValue<string>(Columns.TimeStart); }
			set { SetColumnValue(Columns.TimeStart, value); }
		}
		  
		[XmlAttribute("TimeEnd")]
		[Bindable(true)]
		public string TimeEnd 
		{
			get { return GetColumnValue<string>(Columns.TimeEnd); }
			set { SetColumnValue(Columns.TimeEnd, value); }
		}
		  
		[XmlAttribute("Duration")]
		[Bindable(true)]
		public string Duration 
		{
			get { return GetColumnValue<string>(Columns.Duration); }
			set { SetColumnValue(Columns.Duration, value); }
		}
		  
		[XmlAttribute("ProgramCode")]
		[Bindable(true)]
		public string ProgramCode 
		{
			get { return GetColumnValue<string>(Columns.ProgramCode); }
			set { SetColumnValue(Columns.ProgramCode, value); }
		}
		  
		[XmlAttribute("ProgramName")]
		[Bindable(true)]
		public string ProgramName 
		{
			get { return GetColumnValue<string>(Columns.ProgramName); }
			set { SetColumnValue(Columns.ProgramName, value); }
		}
		  
		[XmlAttribute("Typology")]
		[Bindable(true)]
		public string Typology 
		{
			get { return GetColumnValue<string>(Columns.Typology); }
			set { SetColumnValue(Columns.Typology, value); }
		}
		  
		[XmlAttribute("NominalCost")]
		[Bindable(true)]
		public decimal? NominalCost 
		{
			get { return GetColumnValue<decimal?>(Columns.NominalCost); }
			set { SetColumnValue(Columns.NominalCost, value); }
		}
		  
		[XmlAttribute("RealCost")]
		[Bindable(true)]
		public decimal? RealCost 
		{
			get { return GetColumnValue<decimal?>(Columns.RealCost); }
			set { SetColumnValue(Columns.RealCost, value); }
		}
		  
		[XmlAttribute("PositionInBreak")]
		[Bindable(true)]
		public string PositionInBreak 
		{
			get { return GetColumnValue<string>(Columns.PositionInBreak); }
			set { SetColumnValue(Columns.PositionInBreak, value); }
		}
		  
		[XmlAttribute("NumberOfSpotsInBreak")]
		[Bindable(true)]
		public string NumberOfSpotsInBreak 
		{
			get { return GetColumnValue<string>(Columns.NumberOfSpotsInBreak); }
			set { SetColumnValue(Columns.NumberOfSpotsInBreak, value); }
		}
		  
		[XmlAttribute("TypeOfSpot")]
		[Bindable(true)]
		public string TypeOfSpot 
		{
			get { return GetColumnValue<string>(Columns.TypeOfSpot); }
			set { SetColumnValue(Columns.TypeOfSpot, value); }
		}
		  
		[XmlAttribute("TypeOfBuyCode")]
		[Bindable(true)]
		public string TypeOfBuyCode 
		{
			get { return GetColumnValue<string>(Columns.TypeOfBuyCode); }
			set { SetColumnValue(Columns.TypeOfBuyCode, value); }
		}
		  
		[XmlAttribute("TypeOfBuyName")]
		[Bindable(true)]
		public string TypeOfBuyName 
		{
			get { return GetColumnValue<string>(Columns.TypeOfBuyName); }
			set { SetColumnValue(Columns.TypeOfBuyName, value); }
		}
		  
		[XmlAttribute("ProdVersionCode")]
		[Bindable(true)]
		public string ProdVersionCode 
		{
			get { return GetColumnValue<string>(Columns.ProdVersionCode); }
			set { SetColumnValue(Columns.ProdVersionCode, value); }
		}
		  
		[XmlAttribute("ProdVersionName")]
		[Bindable(true)]
		public string ProdVersionName 
		{
			get { return GetColumnValue<string>(Columns.ProdVersionName); }
			set { SetColumnValue(Columns.ProdVersionName, value); }
		}
		  
		[XmlAttribute("ProductCode")]
		[Bindable(true)]
		public string ProductCode 
		{
			get { return GetColumnValue<string>(Columns.ProductCode); }
			set { SetColumnValue(Columns.ProductCode, value); }
		}
		  
		[XmlAttribute("ProductName")]
		[Bindable(true)]
		public string ProductName 
		{
			get { return GetColumnValue<string>(Columns.ProductName); }
			set { SetColumnValue(Columns.ProductName, value); }
		}
		  
		[XmlAttribute("Constant1")]
		[Bindable(true)]
		public string Constant1 
		{
			get { return GetColumnValue<string>(Columns.Constant1); }
			set { SetColumnValue(Columns.Constant1, value); }
		}
		  
		[XmlAttribute("Constant2")]
		[Bindable(true)]
		public string Constant2 
		{
			get { return GetColumnValue<string>(Columns.Constant2); }
			set { SetColumnValue(Columns.Constant2, value); }
		}
		  
		[XmlAttribute("CategoryCode")]
		[Bindable(true)]
		public string CategoryCode 
		{
			get { return GetColumnValue<string>(Columns.CategoryCode); }
			set { SetColumnValue(Columns.CategoryCode, value); }
		}
		  
		[XmlAttribute("CategoryName")]
		[Bindable(true)]
		public string CategoryName 
		{
			get { return GetColumnValue<string>(Columns.CategoryName); }
			set { SetColumnValue(Columns.CategoryName, value); }
		}
		  
		[XmlAttribute("SubSectorCode")]
		[Bindable(true)]
		public string SubSectorCode 
		{
			get { return GetColumnValue<string>(Columns.SubSectorCode); }
			set { SetColumnValue(Columns.SubSectorCode, value); }
		}
		  
		[XmlAttribute("SubSectorName")]
		[Bindable(true)]
		public string SubSectorName 
		{
			get { return GetColumnValue<string>(Columns.SubSectorName); }
			set { SetColumnValue(Columns.SubSectorName, value); }
		}
		  
		[XmlAttribute("SectorCode")]
		[Bindable(true)]
		public string SectorCode 
		{
			get { return GetColumnValue<string>(Columns.SectorCode); }
			set { SetColumnValue(Columns.SectorCode, value); }
		}
		  
		[XmlAttribute("SectorName")]
		[Bindable(true)]
		public string SectorName 
		{
			get { return GetColumnValue<string>(Columns.SectorName); }
			set { SetColumnValue(Columns.SectorName, value); }
		}
		  
		[XmlAttribute("Constant3")]
		[Bindable(true)]
		public string Constant3 
		{
			get { return GetColumnValue<string>(Columns.Constant3); }
			set { SetColumnValue(Columns.Constant3, value); }
		}
		  
		[XmlAttribute("BrandCode")]
		[Bindable(true)]
		public string BrandCode 
		{
			get { return GetColumnValue<string>(Columns.BrandCode); }
			set { SetColumnValue(Columns.BrandCode, value); }
		}
		  
		[XmlAttribute("BrandName")]
		[Bindable(true)]
		public string BrandName 
		{
			get { return GetColumnValue<string>(Columns.BrandName); }
			set { SetColumnValue(Columns.BrandName, value); }
		}
		  
		[XmlAttribute("AdvertiserCode")]
		[Bindable(true)]
		public string AdvertiserCode 
		{
			get { return GetColumnValue<string>(Columns.AdvertiserCode); }
			set { SetColumnValue(Columns.AdvertiserCode, value); }
		}
		  
		[XmlAttribute("AdvertiserName")]
		[Bindable(true)]
		public string AdvertiserName 
		{
			get { return GetColumnValue<string>(Columns.AdvertiserName); }
			set { SetColumnValue(Columns.AdvertiserName, value); }
		}
		  
		[XmlAttribute("Constant4")]
		[Bindable(true)]
		public string Constant4 
		{
			get { return GetColumnValue<string>(Columns.Constant4); }
			set { SetColumnValue(Columns.Constant4, value); }
		}
		  
		[XmlAttribute("AgencyCode")]
		[Bindable(true)]
		public string AgencyCode 
		{
			get { return GetColumnValue<string>(Columns.AgencyCode); }
			set { SetColumnValue(Columns.AgencyCode, value); }
		}
		  
		[XmlAttribute("AgencyName")]
		[Bindable(true)]
		public string AgencyName 
		{
			get { return GetColumnValue<string>(Columns.AgencyName); }
			set { SetColumnValue(Columns.AgencyName, value); }
		}
		  
		[XmlAttribute("CountryID")]
		[Bindable(true)]
		public string CountryID 
		{
			get { return GetColumnValue<string>(Columns.CountryID); }
			set { SetColumnValue(Columns.CountryID, value); }
		}
		  
		[XmlAttribute("FullVideo")]
		[Bindable(true)]
		public bool? FullVideo 
		{
			get { return GetColumnValue<bool?>(Columns.FullVideo); }
			set { SetColumnValue(Columns.FullVideo, value); }
		}
		  
		[XmlAttribute("ShortVideo")]
		[Bindable(true)]
		public bool? ShortVideo 
		{
			get { return GetColumnValue<bool?>(Columns.ShortVideo); }
			set { SetColumnValue(Columns.ShortVideo, value); }
		}
		  
		[XmlAttribute("FullVideoFile")]
		[Bindable(true)]
		public string FullVideoFile 
		{
			get { return GetColumnValue<string>(Columns.FullVideoFile); }
			set { SetColumnValue(Columns.FullVideoFile, value); }
		}
		  
		[XmlAttribute("ShortVideoFile")]
		[Bindable(true)]
		public string ShortVideoFile 
		{
			get { return GetColumnValue<string>(Columns.ShortVideoFile); }
			set { SetColumnValue(Columns.ShortVideoFile, value); }
		}
		  
		[XmlAttribute("RadioFile")]
		[Bindable(true)]
		public string RadioFile 
		{
			get { return GetColumnValue<string>(Columns.RadioFile); }
			set { SetColumnValue(Columns.RadioFile, value); }
		}
		  
		[XmlAttribute("CableFile")]
		[Bindable(true)]
		public string CableFile 
		{
			get { return GetColumnValue<string>(Columns.CableFile); }
			set { SetColumnValue(Columns.CableFile, value); }
		}
		  
		[XmlAttribute("PreliminaryData")]
		[Bindable(true)]
		public bool? PreliminaryData 
		{
			get { return GetColumnValue<bool?>(Columns.PreliminaryData); }
			set { SetColumnValue(Columns.PreliminaryData, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(string varMediaCode,string varRFDate,string varTimeStart,string varTimeEnd,string varDuration,string varProgramCode,string varProgramName,string varTypology,decimal? varNominalCost,decimal? varRealCost,string varPositionInBreak,string varNumberOfSpotsInBreak,string varTypeOfSpot,string varTypeOfBuyCode,string varTypeOfBuyName,string varProdVersionCode,string varProdVersionName,string varProductCode,string varProductName,string varConstant1,string varConstant2,string varCategoryCode,string varCategoryName,string varSubSectorCode,string varSubSectorName,string varSectorCode,string varSectorName,string varConstant3,string varBrandCode,string varBrandName,string varAdvertiserCode,string varAdvertiserName,string varConstant4,string varAgencyCode,string varAgencyName,string varCountryID,bool? varFullVideo,bool? varShortVideo,string varFullVideoFile,string varShortVideoFile,string varRadioFile,string varCableFile,bool? varPreliminaryData)
		{
			CommercialLog1 item = new CommercialLog1();
			
			item.MediaCode = varMediaCode;
			
			item.RFDate = varRFDate;
			
			item.TimeStart = varTimeStart;
			
			item.TimeEnd = varTimeEnd;
			
			item.Duration = varDuration;
			
			item.ProgramCode = varProgramCode;
			
			item.ProgramName = varProgramName;
			
			item.Typology = varTypology;
			
			item.NominalCost = varNominalCost;
			
			item.RealCost = varRealCost;
			
			item.PositionInBreak = varPositionInBreak;
			
			item.NumberOfSpotsInBreak = varNumberOfSpotsInBreak;
			
			item.TypeOfSpot = varTypeOfSpot;
			
			item.TypeOfBuyCode = varTypeOfBuyCode;
			
			item.TypeOfBuyName = varTypeOfBuyName;
			
			item.ProdVersionCode = varProdVersionCode;
			
			item.ProdVersionName = varProdVersionName;
			
			item.ProductCode = varProductCode;
			
			item.ProductName = varProductName;
			
			item.Constant1 = varConstant1;
			
			item.Constant2 = varConstant2;
			
			item.CategoryCode = varCategoryCode;
			
			item.CategoryName = varCategoryName;
			
			item.SubSectorCode = varSubSectorCode;
			
			item.SubSectorName = varSubSectorName;
			
			item.SectorCode = varSectorCode;
			
			item.SectorName = varSectorName;
			
			item.Constant3 = varConstant3;
			
			item.BrandCode = varBrandCode;
			
			item.BrandName = varBrandName;
			
			item.AdvertiserCode = varAdvertiserCode;
			
			item.AdvertiserName = varAdvertiserName;
			
			item.Constant4 = varConstant4;
			
			item.AgencyCode = varAgencyCode;
			
			item.AgencyName = varAgencyName;
			
			item.CountryID = varCountryID;
			
			item.FullVideo = varFullVideo;
			
			item.ShortVideo = varShortVideo;
			
			item.FullVideoFile = varFullVideoFile;
			
			item.ShortVideoFile = varShortVideoFile;
			
			item.RadioFile = varRadioFile;
			
			item.CableFile = varCableFile;
			
			item.PreliminaryData = varPreliminaryData;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varId,string varMediaCode,string varRFDate,string varTimeStart,string varTimeEnd,string varDuration,string varProgramCode,string varProgramName,string varTypology,decimal? varNominalCost,decimal? varRealCost,string varPositionInBreak,string varNumberOfSpotsInBreak,string varTypeOfSpot,string varTypeOfBuyCode,string varTypeOfBuyName,string varProdVersionCode,string varProdVersionName,string varProductCode,string varProductName,string varConstant1,string varConstant2,string varCategoryCode,string varCategoryName,string varSubSectorCode,string varSubSectorName,string varSectorCode,string varSectorName,string varConstant3,string varBrandCode,string varBrandName,string varAdvertiserCode,string varAdvertiserName,string varConstant4,string varAgencyCode,string varAgencyName,string varCountryID,bool? varFullVideo,bool? varShortVideo,string varFullVideoFile,string varShortVideoFile,string varRadioFile,string varCableFile,bool? varPreliminaryData)
		{
			CommercialLog1 item = new CommercialLog1();
			
				item.Id = varId;
			
				item.MediaCode = varMediaCode;
			
				item.RFDate = varRFDate;
			
				item.TimeStart = varTimeStart;
			
				item.TimeEnd = varTimeEnd;
			
				item.Duration = varDuration;
			
				item.ProgramCode = varProgramCode;
			
				item.ProgramName = varProgramName;
			
				item.Typology = varTypology;
			
				item.NominalCost = varNominalCost;
			
				item.RealCost = varRealCost;
			
				item.PositionInBreak = varPositionInBreak;
			
				item.NumberOfSpotsInBreak = varNumberOfSpotsInBreak;
			
				item.TypeOfSpot = varTypeOfSpot;
			
				item.TypeOfBuyCode = varTypeOfBuyCode;
			
				item.TypeOfBuyName = varTypeOfBuyName;
			
				item.ProdVersionCode = varProdVersionCode;
			
				item.ProdVersionName = varProdVersionName;
			
				item.ProductCode = varProductCode;
			
				item.ProductName = varProductName;
			
				item.Constant1 = varConstant1;
			
				item.Constant2 = varConstant2;
			
				item.CategoryCode = varCategoryCode;
			
				item.CategoryName = varCategoryName;
			
				item.SubSectorCode = varSubSectorCode;
			
				item.SubSectorName = varSubSectorName;
			
				item.SectorCode = varSectorCode;
			
				item.SectorName = varSectorName;
			
				item.Constant3 = varConstant3;
			
				item.BrandCode = varBrandCode;
			
				item.BrandName = varBrandName;
			
				item.AdvertiserCode = varAdvertiserCode;
			
				item.AdvertiserName = varAdvertiserName;
			
				item.Constant4 = varConstant4;
			
				item.AgencyCode = varAgencyCode;
			
				item.AgencyName = varAgencyName;
			
				item.CountryID = varCountryID;
			
				item.FullVideo = varFullVideo;
			
				item.ShortVideo = varShortVideo;
			
				item.FullVideoFile = varFullVideoFile;
			
				item.ShortVideoFile = varShortVideoFile;
			
				item.RadioFile = varRadioFile;
			
				item.CableFile = varCableFile;
			
				item.PreliminaryData = varPreliminaryData;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn MediaCodeColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn RFDateColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn TimeStartColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn TimeEndColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn DurationColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn ProgramCodeColumn
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn ProgramNameColumn
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn TypologyColumn
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn NominalCostColumn
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn RealCostColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn PositionInBreakColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn NumberOfSpotsInBreakColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn TypeOfSpotColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn TypeOfBuyCodeColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        public static TableSchema.TableColumn TypeOfBuyNameColumn
        {
            get { return Schema.Columns[15]; }
        }
        
        
        
        public static TableSchema.TableColumn ProdVersionCodeColumn
        {
            get { return Schema.Columns[16]; }
        }
        
        
        
        public static TableSchema.TableColumn ProdVersionNameColumn
        {
            get { return Schema.Columns[17]; }
        }
        
        
        
        public static TableSchema.TableColumn ProductCodeColumn
        {
            get { return Schema.Columns[18]; }
        }
        
        
        
        public static TableSchema.TableColumn ProductNameColumn
        {
            get { return Schema.Columns[19]; }
        }
        
        
        
        public static TableSchema.TableColumn Constant1Column
        {
            get { return Schema.Columns[20]; }
        }
        
        
        
        public static TableSchema.TableColumn Constant2Column
        {
            get { return Schema.Columns[21]; }
        }
        
        
        
        public static TableSchema.TableColumn CategoryCodeColumn
        {
            get { return Schema.Columns[22]; }
        }
        
        
        
        public static TableSchema.TableColumn CategoryNameColumn
        {
            get { return Schema.Columns[23]; }
        }
        
        
        
        public static TableSchema.TableColumn SubSectorCodeColumn
        {
            get { return Schema.Columns[24]; }
        }
        
        
        
        public static TableSchema.TableColumn SubSectorNameColumn
        {
            get { return Schema.Columns[25]; }
        }
        
        
        
        public static TableSchema.TableColumn SectorCodeColumn
        {
            get { return Schema.Columns[26]; }
        }
        
        
        
        public static TableSchema.TableColumn SectorNameColumn
        {
            get { return Schema.Columns[27]; }
        }
        
        
        
        public static TableSchema.TableColumn Constant3Column
        {
            get { return Schema.Columns[28]; }
        }
        
        
        
        public static TableSchema.TableColumn BrandCodeColumn
        {
            get { return Schema.Columns[29]; }
        }
        
        
        
        public static TableSchema.TableColumn BrandNameColumn
        {
            get { return Schema.Columns[30]; }
        }
        
        
        
        public static TableSchema.TableColumn AdvertiserCodeColumn
        {
            get { return Schema.Columns[31]; }
        }
        
        
        
        public static TableSchema.TableColumn AdvertiserNameColumn
        {
            get { return Schema.Columns[32]; }
        }
        
        
        
        public static TableSchema.TableColumn Constant4Column
        {
            get { return Schema.Columns[33]; }
        }
        
        
        
        public static TableSchema.TableColumn AgencyCodeColumn
        {
            get { return Schema.Columns[34]; }
        }
        
        
        
        public static TableSchema.TableColumn AgencyNameColumn
        {
            get { return Schema.Columns[35]; }
        }
        
        
        
        public static TableSchema.TableColumn CountryIDColumn
        {
            get { return Schema.Columns[36]; }
        }
        
        
        
        public static TableSchema.TableColumn FullVideoColumn
        {
            get { return Schema.Columns[37]; }
        }
        
        
        
        public static TableSchema.TableColumn ShortVideoColumn
        {
            get { return Schema.Columns[38]; }
        }
        
        
        
        public static TableSchema.TableColumn FullVideoFileColumn
        {
            get { return Schema.Columns[39]; }
        }
        
        
        
        public static TableSchema.TableColumn ShortVideoFileColumn
        {
            get { return Schema.Columns[40]; }
        }
        
        
        
        public static TableSchema.TableColumn RadioFileColumn
        {
            get { return Schema.Columns[41]; }
        }
        
        
        
        public static TableSchema.TableColumn CableFileColumn
        {
            get { return Schema.Columns[42]; }
        }
        
        
        
        public static TableSchema.TableColumn PreliminaryDataColumn
        {
            get { return Schema.Columns[43]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"ID";
			 public static string MediaCode = @"MediaCode";
			 public static string RFDate = @"RFDate";
			 public static string TimeStart = @"TimeStart";
			 public static string TimeEnd = @"TimeEnd";
			 public static string Duration = @"Duration";
			 public static string ProgramCode = @"ProgramCode";
			 public static string ProgramName = @"ProgramName";
			 public static string Typology = @"Typology";
			 public static string NominalCost = @"NominalCost";
			 public static string RealCost = @"RealCost";
			 public static string PositionInBreak = @"PositionInBreak";
			 public static string NumberOfSpotsInBreak = @"NumberOfSpotsInBreak";
			 public static string TypeOfSpot = @"TypeOfSpot";
			 public static string TypeOfBuyCode = @"TypeOfBuyCode";
			 public static string TypeOfBuyName = @"TypeOfBuyName";
			 public static string ProdVersionCode = @"ProdVersionCode";
			 public static string ProdVersionName = @"ProdVersionName";
			 public static string ProductCode = @"ProductCode";
			 public static string ProductName = @"ProductName";
			 public static string Constant1 = @"Constant1";
			 public static string Constant2 = @"Constant2";
			 public static string CategoryCode = @"CategoryCode";
			 public static string CategoryName = @"CategoryName";
			 public static string SubSectorCode = @"SubSectorCode";
			 public static string SubSectorName = @"SubSectorName";
			 public static string SectorCode = @"SectorCode";
			 public static string SectorName = @"SectorName";
			 public static string Constant3 = @"Constant3";
			 public static string BrandCode = @"BrandCode";
			 public static string BrandName = @"BrandName";
			 public static string AdvertiserCode = @"AdvertiserCode";
			 public static string AdvertiserName = @"AdvertiserName";
			 public static string Constant4 = @"Constant4";
			 public static string AgencyCode = @"AgencyCode";
			 public static string AgencyName = @"AgencyName";
			 public static string CountryID = @"CountryID";
			 public static string FullVideo = @"FullVideo";
			 public static string ShortVideo = @"ShortVideo";
			 public static string FullVideoFile = @"FullVideoFile";
			 public static string ShortVideoFile = @"ShortVideoFile";
			 public static string RadioFile = @"RadioFile";
			 public static string CableFile = @"CableFile";
			 public static string PreliminaryData = @"preliminaryData";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}
